package cn.mulanbay.auth.common;

import cn.mulanbay.web.common.ApiExceptionHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.web.bind.annotation.ControllerAdvice;

import javax.servlet.http.HttpServletRequest;

/**
 * 异常处理类
 *
 * @author fenghong
 */
@ControllerAdvice
public class AuthExceptionHandler extends ApiExceptionHandler {

    private static final Logger logger = LoggerFactory.getLogger(AuthExceptionHandler.class);

    @Override
    protected void addSystemLog(HttpServletRequest request, Class exceptionClass, String title, String msg, int errorCode) {
        try {
            logger.error("异常exceptionClass="+exceptionClass);
        } catch (Exception e) {
            logger.error("添加系统日志异常", e);
        }
    }

}
